package com.cn.wanxi.control;

import com.cn.wanxi.entity.StudentEntity;
import com.cn.wanxi.entity.UserEntity;
import com.cn.wanxi.entity.UserInfoEntity;
import com.cn.wanxi.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * @version 1.0
 * @author:林建权
 * @Date:2020/3/17 12:32
 */

@Controller
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    /**
     * 学生信息初始化
     * @param id
     * @return
     */
    @RequestMapping("/studentInfo")
    public @ResponseBody UserInfoEntity StudentInfo(Integer id, HttpSession httpSession){
        System.out.println("controller:studentInfo");
        UserInfoEntity user = (UserInfoEntity) httpSession.getAttribute("user");
//        StudentEntity studentEntity = studentService.infoInit(user.getUser_id());
        return user;
    }
}
